package jUnit_tests;
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import model.Address;
import model.NonProfit;

/**
 * Junit test for the NonProfit class.
 * 
 * @author Abdiel Cabrera
 *
 */
public class Junit_test_for_NonProfit {

	private int blocked_nonProfit = 0;
	private NonProfit nonProfit = new NonProfit("Abdiel", "Cabrera", "WTF", "23431", null, new Address("123 crasy St", "", "B", "Miami", "FL", "33125"), "asdvsf@sgfr.com", "my_org");
	
	@Before
	public void setUp() throws Exception {
		
		Address address1 = new Address("123 crasy St", "", "B", "Miami", "FL", "33125");
		NonProfit nonProfit = new NonProfit("Abdiel", "Cabrera", "WTF", "23431", null, address1, "asdvsf@sgfr.com", "my_org");
	    nonProfit.setMy_accessLevel(3);
	    nonProfit.blockNonProfit();
	    blocked_nonProfit = nonProfit.getMy_accessLevel();
	}

	@Test
	public void testblockNonProfit() {
		assertEquals("Block access level", blocked_nonProfit, -1);
	}

	@Test
	public void testsubmitPayment() {
		assertTrue("Was the payment submitted?", nonProfit.submitPayment());
	}
	
	@Test
	public void testcancelAuction(){
		// the auction has been cancelled and therefore it is null
		assertNull(nonProfit.getCurrentAuction());
	}

}
